// 函数类型表达式
type calcFnType = (num1: number, num2: number) => number

function calc(calcFn: calcFnType) {
    const num1 = 10
    const num2 = 20

    const res = calcFn(num1, num2)
    console.log(res)
}

function sum(num1: number, num2: number) {
    return num1 + num2
}

function foo(num1: number) {
    return num1
}

calc(sum)

calc(foo)

// 匿名函数
calc((num1: number, num2: number) => num1 * num2)

export {}
